package com.ruoyi.warehousing.mapper;

import com.ruoyi.product.domain.Product;
import com.ruoyi.warehousing.domain.WarehouseStatisticsVo;
import com.ruoyi.warehousing.domain.Warehousing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface WarehousingMapper {

    /**
     * 查询库存产品信息
     *
     * @return 结果
     */
    List<Product> selectProductToWar(Product product);
    List<WarehouseStatisticsVo> selectProductToWar_new(WarehouseStatisticsVo vo);

    List<Warehousing> selectWarehousingByDept(Warehousing warehousing);

    public void  updateProdcutId(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingDetail(Warehousing warehousing);

    Long sumAllnum(Warehousing warehousing);


    List<Warehousing> selectWarehousingAI(Long deptId);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingThree(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingSix(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingTwo(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingAllMonth(Warehousing warehousing);


    /**
     * 查询库存信息
     *
     * @return 结果集
     */
    List<Product> selectWarehousingToProductList(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingToMonth(Warehousing warehousing);

    /**
     * 查询库存预警信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingWarning(Warehousing warehousing);

    /**
     * 查询库存滞销信息
     *
     * @return 结果
     */
    List<Warehousing> selectWarehousingMore(Warehousing warehousing);

    /**
     * 插入库存 入库数据
     *
     * @param warehousing 库存信息
     * @return 结果
     */
    int insertWarehousing(Warehousing warehousing);

    /**
     * 查询库存信息
     *
     * @param warehousing 查询条件
     * @return 结果
     */
    Warehousing selectWarehousing(Warehousing warehousing);

    /**
     * 更新库存
     *
     * @param warehousing 入库信息
     * @return
     */
    int updateWarehousing(Warehousing warehousing);

    /**
     * 查询产品库存信息 ＰＤＡ
     *
     * @param warehousing
     * @return
     */
    List<Product> selectProductInventoryLists(Warehousing warehousing);

    public void updateWarehousingbatch(Warehousing warehousing);

    /**
     * 查询库存信息 WX
     *
     * @param product 查询条件
     * @return 结果
     */
    List<Product> selectProductInventoryCount(Product product);

    @Select("select count(*) FROM nyt_warehousing WHERE dept_id = #{item.deptId} and product_id = #{item.productId} and product_type = #{item.productType} AND batch = #{item.batch}")
    Integer isExist(@Param("item") Warehousing item);
}
